import AntModal from "@/components/pt/dialog/AntModal";
import UserList from "@/views/biz/customer/modules/components/userlist";
import ChangeUser from "@/views/system/user/modules/ChangeUser";
import OneImageIndex from "@/components/pt/uploader/OneImageIndex";

import {
  getBizJinjianInfo,
  addBizJinjianInfo,
  updateBizJinjianInfo,
  findMaxSort,
  updateBizJinjianInfoShenHe,
  updateBizJinjianInfoQianYue,
  updateBizJinjianInfoFangKuan,
  updateBizJinjianInfoHuiKuan,
  updateBizJinjianInfoConfirmBill,
  updateBizJinjianInfoQingKuan,
  updateBizJinjianInfoConfirmInterest,
  updateBizJinjianInfoYushen,
  updateBizJinjianInfoConfirmAgain,
  updateBizJinjianInfoKefuXinshen,
} from "@/api/biz/bizJinjianInfo";

import { findListByProductId } from "@/api/biz/bizProductFiles";

import { addFiles, delBizJinjianFiles } from "@/api/biz/bizJinjianFiles";
import { getBizCustomer, updateBizCustomer } from "@/api/biz/bizCustomer";
import { listBizProductInfo } from "@/api/biz/bizProductInfo";
import moment from "moment";

export default {
  name: "CreateForm",
  props: {
    jinjianTypeOptions: {
      type: Array,
      required: true,
    },

    backTypeOptions: {
      type: Array,
      required: true,
    },
    orgTypeOptions: {
      type: Array,
      required: true,
    },

    jinjianStatus: {
      type: Number,
    },
    zifangTypeOptions: {
      type: Array,
    },
    customerInfo: {
      type: Object,
    },
  },
  components: {
    AntModal,
    UserList,
    ChangeUser,
    OneImageIndex,
  },
  data() {
    return {
      productFiles: [],
      nameValue: "身份证",
      fileList: [],
      open: false,
      spinning: false,
      delayTime: 100,
      labelCol: { span: 4 },
      wrapperCol: { span: 14 },
      loading: false,
      refuseLoading: false,
      total: 0,
      id: undefined,
      formTitle: "添加客户进件",
      // 客户进件表单参数
      form: {},
      rules: {
        customerName: [
          { required: true, message: "客户不能为空", trigger: "blur" },
        ],
        servcieUserName: [
          { required: true, message: "客服不能为空", trigger: "blur" },
        ],
        yxEdu: [
          { required: true, message: "申请金额不能为空", trigger: "blur" },
        ],
        sjEdu: [
          { required: true, message: "签约金额不能为空", trigger: "blur" },
        ],
        serviceAmount: [
          { required: true, message: "服务费用不能为空", trigger: "blur" },
        ],
        fenqiTime: [
          { required: true, message: "分期时间不能为空", trigger: "change" },
        ],
        isTgOne: [
          { required: true, message: "请选择是否通过", trigger: "blur" },
        ],
        isTgTwo: [
          { required: true, message: "请选择是否通过", trigger: "blur" },
        ],
        isTgThree: [
          { required: true, message: "请选择是否通过", trigger: "blur" },
        ],
        fkTime: [
          { required: true, message: "放款时间不能为空", trigger: "change" },
        ],
        zfei: [
          { required: true, message: "服务费用不能为空", trigger: "blur" },
        ],

        remarkOne: [
          { required: true, message: "审核备注不能为空", trigger: "blur" },
        ],
        orgType: [{ required: true, message: "请选择机构", trigger: "blur" }],
        productId: [{ required: true, message: "请选择产品", trigger: "blur" }],
        backType: [
          { required: true, message: "请选择还款方式", trigger: "blur" },
        ],
        lv: [{ required: true, message: "请输入年利率", trigger: "blur" }],
        monthlyPayDate: [
          { required: true, message: "请选择每月还款日", trigger: "change" },
        ],
        agreeServiceAmount: [
          { required: true, message: "请确认服务费用", trigger: "change" },
        ],
      }, //
      productList: [],
      productListTwo: [],
      productListThree: [],
      visibleShowUser: false,
      chooseUserVisible: false,
      proOne: false,
      proTwo: false,
      proThree: false,
      isFanganSave: false,
      // 客户信息表单参数
      customerForm: {},

      monthlyPayment: 0,
      totalPayment: 0,
      totalInterest: 0,
      paymentSchedule: [],
    };
  },
  filters: {},
  created() {},
  computed: {},
  watch: {},
  mounted() {},
  methods: {
    removeFile(file) {
      var id = file.uid;
      if (file.response) {
        id = file.response.data.uid;
      }
      delBizJinjianFiles(id).then(() => {
        // const jinjianFiles = response.data;
        this.$message.success("删除成功", 3);
        this.$emit("ok");
        // this.$emit("close");
      });
    },

    saveJinjianFiles(productFile, data) {
      const jinjianFiles = {
        filesName: productFile.filesName,
        fileUrl: data.url,
        id: data.uid,
        jinjianId: this.form.id,
        productId: productFile.productId,
      };
      console.log("jinjianFiles", jinjianFiles);

      addFiles(jinjianFiles).then((response) => {
        // const jinjianFiles = response.data;

        this.$message.success("上传成功", 3);
        this.$emit("ok");
        // this.$emit("close");
      });
    },

    handleFenqiTimeChange() {
      // 当分期时间变化时，重新计算月供
      this.handleChangeMonthAmount();
      // 自动计算到期时间
      this.handleOverTimeChange();
    },
    // 计算贷款月供费用
    handleChangeMonthAmount() {
      const P = this.form.sjEdu; // 贷款金额
      const n = this.form.fenqiTime; // 贷款期数
      const r = this.form.lv / 100 / 12; // 年利率
      const method = this.form.backType; // 还款方式
      console.log("P", P, "n", n, "r", r, "method", method);
      if (P && n && r && method) {
        let monthlyPayment = 0;
        let totalPayment = 0;
        let totalInterest = 0;
        let repaymentSchedule = [];

        // 根据还款方式计算
        switch (method) {
          case "debx": {
            monthlyPayment =
              (P * r * Math.pow(1 + r, n)) / (Math.pow(1 + r, n) - 1);
            totalPayment = monthlyPayment * n;
            totalInterest = totalPayment - P;

            const paymentSchedule = [];
            let remaining = P;
            for (let i = 1; i <= n; i++) {
              const interest = remaining * r;
              const principal = monthlyPayment - interest;
              remaining -= principal;

              paymentSchedule.push({
                key: i,
                period: i,
                payment: monthlyPayment.toFixed(2),
                principal: principal.toFixed(2),
                interest: interest.toFixed(2),
                remaining: Math.max(0, remaining).toFixed(2),
              });
            }
            repaymentSchedule = paymentSchedule;
            this.repaymentMethodText = "等额本息";
            break;
          }

          case "xxhb": {
            const monthlyInterest = P * r;
            monthlyPayment = monthlyInterest;
            totalInterest = monthlyInterest * n;
            totalPayment = P + totalInterest;

            const paymentSchedule = [];
            for (let i = 1; i <= n; i++) {
              const isLastPeriod = i === n;
              const payment = isLastPeriod
                ? P + monthlyInterest
                : monthlyInterest;
              const principal = isLastPeriod ? P : 0;
              const remaining = isLastPeriod ? 0 : P;

              paymentSchedule.push({
                key: i,
                period: i,
                payment: payment.toFixed(2),
                principal: principal.toFixed(2),
                interest: monthlyInterest.toFixed(2),
                remaining: remaining.toFixed(2),
              });
            }
            repaymentSchedule = paymentSchedule;
            this.repaymentMethodText = "先息后本";
            break;
          }

          case "dbdx": {
            const monthlyPrincipal = P / n;
            const fixedInterest = P * r;
            monthlyPayment = monthlyPrincipal + fixedInterest;
            totalInterest = fixedInterest * n;
            totalPayment = P + totalInterest;

            const paymentSchedule = [];
            let remaining = P;
            for (let i = 1; i <= n; i++) {
              remaining -= monthlyPrincipal;

              paymentSchedule.push({
                key: i,
                period: i,
                payment: monthlyPayment.toFixed(2),
                principal: monthlyPrincipal.toFixed(2),
                interest: fixedInterest.toFixed(2),
                remaining: Math.max(0, remaining).toFixed(2),
              });
            }
            repaymentSchedule = paymentSchedule;
            this.repaymentMethodText = "等本等息";
            break;
          }
        }

        this.monthlyPayment = monthlyPayment.toFixed(2); // 月供
        this.totalPayment = totalPayment.toFixed(2); // 总还款
        this.totalInterest = totalInterest.toFixed(2); // 总利息
        this.paymentSchedule = repaymentSchedule; // 还款计划

        this.form.monthAmount = monthlyPayment.toFixed(2); // 更新表单中的月供金额
      }
    },
    handleChangeConfirmAmount() {
      console.log(
        "this.form.serviceKeyAmount ",
        this.form.serviceKeyAmount || 0
      );
      this.form.serviceConfirmAmount =
        (this.form.serviceAmount || 0) -
        (this.form.serviceKeyAmount || 0) -
        (this.form.serviceInsuranceAmount || 0) -
        (this.form.serviceDealAmount || 0) -
        (this.form.serviceSignAmount || 0) -
        (this.form.serviceGpsAmount || 0) -
        (this.form.serviceDiyaAmount || 0) -
        (this.form.serviceJieyaAmount || 0) -
        (this.form.servicePayAmount || 0) -
        (this.form.serviceOtherAmount || 0);
    },

    handleGpsOnChange(e) {
      const value = e.target.value;
      if (value === "2") {
        if (this.form.serviceAmountRemark) {
          this.form.serviceAmountRemark =
            this.form.serviceAmountRemark + " 不安装GPS";
        } else {
          this.form.serviceAmountRemark = " 不安装GPS";
        }
      } else {
        if (this.form.serviceAmountRemark.indexOf(" 不安装GPS") !== -1) {
          this.form.serviceAmountRemark = this.form.serviceAmountRemark.replace(
            " 不安装GPS",
            ""
          );
        }
      }
    },

    // 自动计算到期时间
    handleOverTimeChange() {
      if (this.form.fkTime && this.form.fenqiTime) {
        console.log("this.form.fkTime", this.form.fkTime);
        const overTime = this.addMonths(
          this.form.fkTime,
          this.form.fenqiTime
        ).toLocaleString();
        this.form.overTime = overTime;
        console.log("overtime", overTime);
      }
    },
    addMonths(date, months) {
      // return moment(date).add(months, "months").toDate();
      // 或者返回字符串格式
      return moment(date).add(months, "months").format("YYYY-MM-DD");
    },

    // 获取选择后的人员信息
    handleManualShare(users) {
      this.form.servcieUserId = users[0].id;
      this.form.servcieUserName = users[0].name;
      let userIds = "";
      let userName = "";
      if (users.length > 1) {
        // users.map((item) => {
        //   userIds += item.id + ",";
        //   userName += item.name + ",";
        // });

        for (var i = 0; i < users.length; i++) {
          var item = users[i];
          if (i === users.length - 1) {
            userIds += item.id;
            userName += item.name;
          } else {
            userIds += item.id + ",";
            userName += item.name + ",";
          }
        }
        this.form.servcieUserId = userIds;
        this.form.servcieUserName = userName;
      }
    },
    handleChooseProduct(val, options) {
      this.form.productId = val;
      this.form.productName = options.key;
    },
    handleChooseProductTwo(val, options) {
      this.form.productIdTwo = val;
      this.form.productNameTwo = options.key;
    },
    handleChooseProductThree(val, options) {
      this.form.productIdThree = val;
      this.form.productNameThree = options.key;
    },

    // 信审查询产品对应的资料
    handleChooseProductXinshen(val, options) {
      this.form.productId = val;
      this.form.productName = options.key;
      this.getProductFilesByProductId(val);
    },
    handleChooseProductTwoXinshen(val, options) {
      this.form.productIdTwo = val;
      this.form.productNameTwo = options.key;
      this.getProductFilesByProductId(val);
    },
    handleChooseProductThreeXinshen(val, options) {
      this.form.productIdThree = val;
      this.form.productNameThree = options.key;
      this.getProductFilesByProductId(val);
    },

    getProductFilesByProductId(productId) {
      const param = { productId: productId, jinjianId: this.form.id };
      findListByProductId(param).then((response) => {
        this.productFiles = response.data;
        console.log("productFiles", this.productFiles);
      });
    },

    handleOnSearchCustomer() {
      this.visibleShowUser = true;
    },
    // 获取客户信息
    getCustomerInfo(item) {
      if (item) {
        this.form.customerName = item.cusName;
        if (item.id) {
          this.form.customerId = item.id;
        } else {
          this.form.customerId = item.customerId;
        }
        this.form.phone = item.phone;
        this.form.idCard = item.idCard;
        this.form.toHomeUserId = item.toHomeUserId; // 如果是上门进行方案确认的
        this.form.laiyuan = item.laiyuan; // 来源
        const bizCustomerId = this.form.customerId;
        getBizCustomer(bizCustomerId).then((response) => {
          this.customerForm = response.data;
        });
      }
      this.visibleShowUser = false;
    },
    onClose() {
      this.open = false;
      this.reset();
      this.$emit("close");
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
      this.$emit("close");
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        monthAmount: undefined,

        companyId: undefined,

        customerId: undefined,

        idCard: undefined,

        customerName: undefined,

        phone: undefined,

        orgType: undefined,

        productId: undefined,

        productName: undefined,

        jinjianType: undefined,

        yxEdu: undefined,

        sjEdu: undefined,

        lv: undefined,

        backType: undefined,

        fenqiTime: undefined,

        diyaTime: undefined,

        productTiaojian: undefined,

        qiandanTime: undefined,

        serviceAmount: undefined,

        serviceAmountRemark: undefined,

        servcieUserName: undefined,

        servcieUserId: undefined,

        sort: undefined,

        status: undefined,
      };

      this.customerForm = {
        id: undefined,
        carType: undefined,
        chassisNo: undefined,
        mileage: undefined,
        isBelong: undefined,
        isLoan: undefined,
        mortgageStatus: undefined,
        loanStatus: undefined,
        realName: undefined,
        bankName: undefined,
        bankNum: undefined,
        idCardStartTime: undefined,
        idCardEndTime: undefined,
      };
    },
    // 预审
    handleYuShen(status) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.form.jinjianStatus = status;
          this.loading = true;
          updateBizJinjianInfoYushen(this.form).then((res) => {
            this.$message.success("预审成功", 3);
            this.open = false;
            this.loading = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },
    // 退回预审
    handleYuShenRefuse(status) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.form.jinjianStatus = status;
          this.refuseLoading = true;
          updateBizJinjianInfoYushen(this.form).then((res) => {
            this.$message.success("退回成功", 3);
            this.open = false;
            this.refuseLoading = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },

    // 费用确认
    handleJinjianConfirmBill(status) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.isFanganSave = true;
          this.form.jinjianStatus = status;
          updateBizJinjianInfoConfirmBill(this.form).then((res) => {
            this.$message.success("确认成功", 3);
            this.isFanganSave = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },
    // 费用不接受
    handleJinjianConfirmBillRefuse(status) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.refuseLoading = true;
          this.form.jinjianStatus = status;
          updateBizJinjianInfoConfirmBill(this.form).then((res) => {
            this.$message.success("确认成功", 3);
            this.refuseLoading = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },

    // 费率确认
    handleJinjianConfirmInterest(status) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.isFanganSave = true;
          this.form.jinjianStatus = status;
          updateBizJinjianInfoConfirmInterest(this.form).then((res) => {
            this.$message.success("确认成功", 3);
            this.isFanganSave = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },

    // 费率不接受
    handleJinjianConfirmInterestRefuse(status) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.refuseLoading = true;
          this.form.jinjianStatus = status;
          updateBizJinjianInfoConfirmInterest(this.form).then((res) => {
            this.$message.success("确认成功", 3);
            this.refuseLoading = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },

    // 重新方案确认
    handleJinjianConfirmAgain(status) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.loading = true;
          this.form.jinjianStatus = status;
          updateBizJinjianInfoConfirmAgain(this.form).then((res) => {
            this.$message.success("操作成功", 3);
            this.loading = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },

    // 资料信审
    handleJinjianXinshen(status) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.form.jinjianStatus = status;
          this.loading = true;
          updateBizJinjianInfoKefuXinshen(this.form).then((res) => {
            this.$message.success("审批通过", 3);
            this.loading = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },

    // 审批通过
    handleJinjianShenhe(status) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.form.jinjianStatus = status;
          this.loading = true;
          updateBizJinjianInfoShenHe(this.form).then((res) => {
            this.$message.success("审批通过", 3);
            this.loading = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },
    // 审批驳回
    handleJinjianShenheRefuse(status) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.form.jinjianStatus = status;
          this.refuseLoading = true;
          updateBizJinjianInfoShenHe(this.form).then((res) => {
            this.$message.success("驳回成功", 3);
            this.refuseLoading = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },

    // 签约
    handleJinjianQianYue(jinjianStatus) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.loading = true;
          this.form.jinjianStatus = jinjianStatus;
          updateBizJinjianInfoQianYue(this.form).then((res) => {
            this.$message.success("操作成功", 3);
            this.loading = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },

    // 请款
    handleJinjianQingKuan(jinjianStatus) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.loading = true;
          this.form.jinjianStatus = jinjianStatus;
          updateBizJinjianInfoQingKuan(this.form).then((res) => {
            this.$message.success("请款成功", 3);
            this.loading = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },
    // 放款
    handleConfirmFangkuan(jinjianStatus) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.form.monthlyPayment = this.monthlyPayment; // 月供
          this.form.totalPayment = this.totalPayment; // 总还款
          this.form.totalInterest = this.totalInterest; // 总利息
          this.form.paymentSchedule = this.paymentSchedule;
          this.loading = true;
          this.form.jinjianStatus = jinjianStatus;
          const saveForm = JSON.parse(JSON.stringify(this.form));
          updateBizJinjianInfoFangKuan(saveForm).then((res) => {
            this.$message.success("放款成功", 3);
            this.loading = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },
    // 回款
    handleConfirmHuikuan(jinjianStatus) {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.loading = true;
          this.form.jinjianStatus = jinjianStatus;
          updateBizJinjianInfoHuiKuan(this.form).then((res) => {
            this.$message.success("回款成功", 3);
            this.loading = false;
            this.open = false;
            this.$emit("ok");
            this.$emit("close");
          });
        }
      });
    },

    /** 获取产品信息 */
    handleGetProductInfo(value) {
      if (value) {
        listBizProductInfo({ orgType: value, pageSize: 50 }).then((res) => {
          this.productList = res.data.list;
          // this.form.productId = undefined;
          // this.productFiles = [];
        });
      }
    },
    /** 获取产品信息 */
    handleGetProductInfoTwo(value) {
      if (value) {
        listBizProductInfo({ orgType: value, pageSize: 50 }).then((res) => {
          this.productListTwo = res.data.list;
          // this.form.productIdTwo = undefined;
          // this.productFiles = [];
        });
      }
    },
    /** 获取产品信息 */
    handleGetProductInfoThree(value) {
      if (value) {
        listBizProductInfo({ orgType: value, pageSize: 50 }).then((res) => {
          this.productListThree = res.data.list;
          // this.form.productIdThree = undefined;
          // this.productFiles = [];
        });
      }
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      /** 获取最大编号 */
      findMaxSort().then((response) => {
        this.form.sort = response.data;
        this.formTitle = "添加客户进件";
      });

      this.getCustomerInfo(this.customerInfo);
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      this.open = true;
      this.spinning = !this.spinning;
      const bizJinjianInfoId = row.id;
      getBizJinjianInfo(bizJinjianInfoId).then((response) => {
        this.form = response.data;
        this.form.toHomeUserId = row.toHomeUserId;
        console.log("form", this.form);

        this.formTitle = "更新客户进件";
        this.spinning = !this.spinning;

        this.handleGetProductInfo(this.form.orgType);

        this.handleGetProductInfoTwo(this.form.orgTypeTwo);

        this.handleGetProductInfoThree(this.form.orgTypeThree);
        this.proOne =
          this.form.orgType !== null &&
          this.form.orgType !== undefined &&
          this.form.isTgOne === "1";

        console.log("proOne", this.proOne);

        this.proTwo =
          this.form.orgTypeTwo !== null &&
          this.form.orgTypeTwo !== undefined &&
          this.form.isTgTwo === "1";
        this.proThree =
          this.form.orgTypeThree !== undefined &&
          this.form.orgTypeThree !== null &&
          this.form.isTgThree === "1";

        if (this.form.productId && this.form.isTgOne === "1") {
          this.getProductFilesByProductId(this.form.productId);
        }

        if (this.form.productIdTwo && this.form.isTgTwo === "1") {
          this.getProductFilesByProductId(this.form.productIdTwo);
        }

        if (this.form.productIdThree && this.form.isTgThree === "1") {
          this.getProductFilesByProductId(this.form.productIdThree);
        }

        const bizCustomerId = this.form.customerId;
        getBizCustomer(bizCustomerId).then((response) => {
          this.customerForm = response.data;
        });
      });
    },
    /** 提交按钮 */
    submitForm: function () {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.isFanganSave = true;
          const saveForm = JSON.parse(JSON.stringify(this.form));
          saveForm.serviceAmount =
            saveForm.zfei + (saveForm.yxEdu * saveForm.glFei) / 100;

          updateBizCustomer(this.customerForm).then((response) => {
            if (this.form.id !== undefined) {
              // 预审/审批 驳回重新确认方案
              if (
                saveForm.jinjianStatus === "-2" ||
                saveForm.jinjianStatus === "-5" ||
                saveForm.jinjianStatus === "-13" ||
                saveForm.jinjianStatus === "-16"
              ) {
                saveForm.jinjianStatus = 0;
              }
              updateBizJinjianInfo(saveForm).then((response) => {
                this.$message.success("修改成功", 3);
                this.open = false;
                this.$emit("ok");
                this.$emit("close");
                this.isFanganSave = false;
              });
            } else {
              if (this.jinjianStatus === 2) {
                saveForm.jinjianStatus = this.jinjianStatus;
                saveForm.status = "1";
              } else {
                saveForm.status = "0";
                saveForm.jinjianStatus = "0";
              }

              // saveForm.customerId = this.customerInfo.id;
              addBizJinjianInfo(saveForm).then((response) => {
                this.$message.success("保存成功", 3);
                this.open = false;
                this.$emit("ok");
                this.$emit("close");
                this.isFanganSave = false;
              });
            }
          });
        } else {
          return false;
        }
      });
    },
    back() {
      const index = "/biz/jinjianinfo/index";
      this.$router.push(index);
    },
  },
};
